package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.SysPushMoney;
import com.ruoyi.system.mapper.SysPushMoneyMapper;
import com.ruoyi.system.service.ISysPushMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 提成Service业务层处理
 * 
 * @author paul
 * @date 2023-06-25
 */
@Service
public class SysPushMoneyServiceImpl implements ISysPushMoneyService
{
    @Resource
    private SysPushMoneyMapper sysPushMoneyMapper;

    /**
     * 查询提成
     * 
     * @param id 提成主键
     * @return 提成
     */
    @Override
    public SysPushMoney selectSysPushMoneyById(Long id)
    {
        return sysPushMoneyMapper.selectSysPushMoneyById(id);
    }

    /**
     * 查询提成列表
     * 
     * @param sysPushMoney 提成
     * @return 提成
     */
    @Override
    public List<SysPushMoney> selectSysPushMoneyList(SysPushMoney sysPushMoney)
    {
        return sysPushMoneyMapper.selectSysPushMoneyList(sysPushMoney);
    }

    /**
     * 新增提成
     * 
     * @param sysPushMoney 提成
     * @return 结果
     */
    @Override
    public int insertSysPushMoney(SysPushMoney sysPushMoney)
    {
        sysPushMoney.setCreateTime(DateUtils.getNowDate());
        return sysPushMoneyMapper.insertSysPushMoney(sysPushMoney);
    }

    /**
     * 修改提成
     * 
     * @param sysPushMoney 提成
     * @return 结果
     */
    @Override
    public int updateSysPushMoney(SysPushMoney sysPushMoney)
    {
        sysPushMoney.setUpdateTime(DateUtils.getNowDate());
        return sysPushMoneyMapper.updateSysPushMoney(sysPushMoney);
    }

    /**
     * 批量删除提成
     * 
     * @param ids 需要删除的提成主键
     * @return 结果
     */
    @Override
    public int deleteSysPushMoneyByIds(Long[] ids)
    {
        return sysPushMoneyMapper.deleteSysPushMoneyByIds(ids);
    }

    /**
     * 删除提成信息
     * 
     * @param id 提成主键
     * @return 结果
     */
    @Override
    public int deleteSysPushMoneyById(Long id)
    {
        return sysPushMoneyMapper.deleteSysPushMoneyById(id);
    }
}
